Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Finder Dialog Box Messages


GXHandleAlertEvent

You need to override the GXHandleAlertEvent message if you are providing custom handling of printing alerts. Your override code of the GXHandleAlertEvent message must match the following formal declaration:

OSErr MyHandleAlertEvent (gxStatusRecord *aStatusRecord,
 DialogPtr *aDialogPtr, EventRecord *theEvent, short *itemHit);
aStatusRecord
A pointer to the status structure.
aDialogPtr
The handle to the printing alert box.
theEvent
A pointer to the event structure containing the alert event.
itemHit
The ID of the dialog item that was selected by the user.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX sends the GXHandleAlertEvent message when a printer driver calls the GXAlertTheUser function with a status structure containing a status type of gxUserAlert.

The default implementation of this message handles the standard set of status alerts. If this message is forwarded to the universal driver and if it is not a message for the universal driver, the default implementation assumes that the caller has set up a printing alert box and handles the event accordingly.

You do not need to override this message if your alert is one of the standard alerts for which QuickDraw GX provides automatic handling, as described in the chapter "Printer Drivers" in this book. If you want to provide custom alerts, first check the statusOwner field of the status structure to make sure that this message is intended for you. If so, perform a total override of this message.

In your override, you need to check the event. If the status event dismisses the printing alert box, fill in the dialogResult field of the status structure with a nonzero value to inform the Finder that the dialog box can be removed.

SPECIAL CONSIDERATIONS
You never send the GXHandleAlertEvent message yourself.

If you handle the event, you must totally override the GXHandleAlertEvent message. Otherwise, forward the message so that another message handler can process the event.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
SEE ALSO
You can find an example of an override of the GXHandleAlertEvent message in Listing 3-18 on page 3-48 in the chapter "Printer Drivers."

The GXAlertTheUser function is described on page 5-18 in the chapter "Printing Functions for Message Overrides."

The status structure is described on page 4-39.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help